<?php
include "../../inc/log/adsession.php";
include "../../inc/data/connAdmin.php";
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<?php 
	$menuName = $_POST["menuname"];
	$Link = $_POST["link"];
	$reMark = $_POST["remark"];
	$tePer = $_POST["tep"];
	$stuPer = $_POST["stu"];
	$Score = $_POST["score"];
	$User = $_POST["user"];
	//检查重名
	$sql = "insert into mamx_menu  
			(menuname,link,remark,tePre,stuPre,score,user)
			values (?,?,?,?,?,?,?)";
	$stmt= $conn->prepare($sql);
	$stmt->bind_param("sssssss",$menuName,$Link,$reMark,$tePer,$stuPer,$Score,$User);
	$stmt->execute();
	if ($stmt->affected_rows==1) {
			echo <<<END
			<script type="text/javascript">
			alert("菜单添加成功！");
			location="menuAdmin.php";
			</script>
END;
			}
	?>
</body>
</html>